Skip to content

✨ feat: implement scalatest integration #373

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

✨ feat: implement scalatest integration #373

wants to merge 1 commit into from

Conversation

gaeljw
Copy link
Member

@gaeljw gaeljw commented Apr 21, 2024

No description provided.

@gaeljw gaeljw self-assigned this Apr 21, 2024
@gaeljw gaeljw linked an issue Apr 21, 2024 that may be closed by this pull request
@gaeljw gaeljw added ⚡ enhancement Request for new functionality 🍼 incomplete Blocked until more information is provided labels Apr 21, 2024
@dfurmans dfurmans self-requested a review June 18, 2024 20:42
options: T
): Try[RuntimeOptionsBuilder] = {
Try {
// TODO verify how getClass behaves with the trait
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So let`s say

trait CucumberSuiteOptions
trait CucumberSuiteOptionSpf extends CucumberSuiteOptions
def parse[T <: CucumberSuiteOptions](options: T with CucumberSuiteOptions): String = {
  val clazz = options.getClass
   clazz.toString
}
parse(new CucumberSuiteOptionSpf{}) // val res3: String = class rs$line$16$$anon$1

In Welcome to Scala 3.3.1 (17.0.2, Java OpenJDK 64-Bit Server VM).


class RunCukesTest extends CucumberSuite with CucumberSuiteOptions {

override def featuresPath: Seq[String] = Nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about Functor Option to express something that could be ... could be

parse(options) match {
case Success(value) => value
case Failure(exception) =>
println(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we sure that we would like to have this print in SOUT asis ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not but so far I just got inspired from the cucumber-junit module and copy/pasted stuff from there.

private val context: CucumberExecutionContext
) extends Suite {

private val children: Seq[PickleSuite] = {
Copy link
Contributor

@mpkorstanje mpkorstanje Jun 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How many levels of hierarchy can Scala test express? If more than 2, it might be worthwhile to match the layout in the feature file. Representing only the feature and pickles was a JUnit 4 limitation.

@gaeljw
Copy link
Member Author

gaeljw commented Jun 22, 2024

@dfurmans @mpkorstanje this is a very first draft, I don't even remember if it compiles yet 😅 No need for a deep review for now I guess.

I don't have plans to work on it in the coming weeks, if anyone wants to take over and complete it, I'm perfectly fine with that :)

@mpkorstanje
Copy link
Contributor

Alright, no worries! I'm currently working on some stuff in cucumber for junit 5 that is somewhat related.

@Leon0402
Copy link

It is great that Cucumber Scala finally is supported with JUnit5 (#399). Thanks @mpkorstanje and @gaeljw for following up on my bug report (sbt/sbt-jupiter-interface#142 (comment))! I will check this out very soon and see if it resolves my issues as well.
But overall I would still love to see a proper ScalaTest integration. I lack the experience (and also the time) to do it myself, unfortunately. Is this something still on your roadmap, @gaeljw and @mpkorstanje? The PR looks, unfortunately, a bit abandoned.

@gaeljw
Copy link
Member Author

gaeljw commented Jul 15, 2025

@Leon0402 it's still in my radar but quite low priority. I also lack some more knowledge of Scalatest to be efficient on this topic. It's good to hear that there are some users interested though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍼 incomplete Blocked until more information is provided ⚡ enhancement Request for new functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide a cucumber-scalatest integration
4 participants